import { createI18n } from 'vue-i18n'
import { kebabCase, mapKeys } from 'lodash-es'
import zhCn from './lang/zh-cn.json'

const i18n = createI18n({
  locale: 'zh',
  legacy: false,
  globalInjection: true,
  fallbackLocale: 'zh',
  messages: mapKeys({
    zh: zhCn,
    zhCn,
  }, (_, key) => kebabCase(key)),
})

export default i18n
